<?php
  include("../conn.php");
  $id = $_GET['id'];
  $avatar = $_GET['avatar'];
  $last_login = $_GET['last_login'];
  if ($avatar == 'null') $sql = "UPDATE `user` set `last_login` = '$last_login' where `id`='$id'";
  else $sql = "UPDATE `user` set `last_login` = '$last_login', `avatar` = '$avatar' where `id`='$id'";
  $query = mysql_query($sql);
  print_r(json_encode('User login updated.'));
?>